
	
	<div class="column full fl">
		
			<div class="box themed_box">

	<h2 class="box-header"><?php echo $title; ?></h2>
	<div class="box-content">
     <?php if($title==$this->lang->line('adv_search')): ?>
     <form id="formtest" name="formtest" method="post" action="<?php echo site_url($form['action']); ?>">
        <label ><?php echo $this->lang->line('date'); ?></label>
	    <input name="datestart" class="form-field datepicker" type="text" value="" />
        -
        <input name="datefinish" class="form-field datepicker" type="text" value="" />
        
        <label><?php echo $this->lang->line('type'); ?></label>
            <select  class="form-field width10" id="select" name="type_search" title="Select a category">
                   <option value=""> - </option>  
    				<?php foreach($table['type'] as $rowactv): ?>
                    <option value="<?php echo $rowactv['id']; ?>"><?php echo $rowactv['activity_type']; ?></option>
                <?php endforeach;?>
            </select>
       <label><?php echo $this->lang->line('pic'); ?></label>
            <select  class="form-field width10" id="select" name="user_search" title="Select a category">
                   <option value=""> - </option>  
    				<?php foreach($table['users'] as $rowuser): ?>
                    <option value="<?php echo $rowuser['username']; ?>"><?php echo $rowuser['username']; ?></option>
                <?php endforeach;?>
            </select>     
			<input id="reset" class="button red" type="button" value="Reset" name="reset" />
			<input id="validate" class="button themed" type="submit" value="<?php echo $this->lang->line('search');?>" name="search" />
			<a class="button themed" href="<?=site_url('activity/crm/report/')?>"/>Export</a>
           
     </form>
    <?php endif; ?>
	<?php //<strong></strong>echo $this->session->flashdata('message');?>
	<table class="display" id="tabledata">
	<thead>
		<tr>
			<th><?php echo $this->lang->line('no');?></th>
			<th><?php echo $this->lang->line('date');?></th>
            <th><?php echo $this->lang->line('time');?></th>
			<th><?php echo $this->lang->line('customer_name');?></th>
            <th><?php echo $this->lang->line('pic');?></th>
            <th><?php echo $this->lang->line('tlp');?></th>
            <th><?php echo $this->lang->line('type');?></th>
			<!--<th><?php echo $this->lang->line('user_group');?></th>
			<th><?php echo $this->lang->line('user_pos');?></th>-->
            <?php //if($this->session->userdata('user_group')== $this->config->item('admin')):?>
            <?php if($this->session->userdata('user_pos')<> $access ): ?>
            <th><?php echo $this->lang->line('pic');?></th>
            <?php endif;?>
			<?php if(($this->session->userdata('user_pos')== $access) || ($this->session->userdata('user_group')== $this->config->item('admin')) ): ?>
            <th>Action</th>
			<?php endif;?>
		</tr>
	</thead>
	<tbody>
	<?php $i=1; foreach($table['activity'] as $rec): ?>
		<tr class="gradeX">

			<td><?php echo $i; ?></td>
			<td><?php echo $rec['activity_date'] ?></td>
            <td><?php echo $rec['activity_time'] ?></td>
			<td><?php echo $rec['customer_name'] ?></td>
            <td><?php echo $rec['cust'] ?></td>
            <td><?php echo $rec['tlp'] ?></td>
            <td><?php echo $rec['activity_type'] ?></td>
			<!--<td class="center"><?php // echo $rec['group_name'] ?></td>
			<td class="center"><?php // echo $rec['pos_name'] ?></td>-->
            <?php //if($this->session->userdata('user_group')== $this->config->item('admin')):?>
            <?php if($this->session->userdata('user_pos')<> $access  ): ?>
			<td class="center"><?php  echo $rec['pic'] ?></td>
            <?php endif;?>
            
            <?php if(($this->session->userdata('user_pos')== $access) || ($this->session->userdata('user_group')== $this->config->item('admin')) || ($this->session->userdata('user_group')== $this->config->item('co_admin')) ): ?>
            <td class="tc">
                <a class="button white" href="<?php echo site_url($this->config->item('actv_view').$rec['id']); ?>"><span class="icon_single video"></span></a>
                <a class="button white" href="<?php echo site_url($this->config->item('actv_delete').$rec['id']); ?>"><span class="icon_single cancel"></span></a>
				<a class="button white" href="<?php echo site_url($this->config->item('actv_edit').$rec['id']); ?>"><span class="icon_single edit"></span></a>
            </td>
			<?php endif;?>
		</tr>
	<?php $i++;endforeach;?>	
	</tbody>
	</table>
	<div class="clear"></div>
	</div>
	</div>
	
	</div>
	
	<!-- half 
	<div class="column onehalf fr">
	
		<div class="box themed_box">
			<h2 class="box-header-new"></h2>

			<h2 class="box-header">	box table - gallery</h2>
			<div class="box-content box-table">
			dsdfs
			</div>
		</div>
	
	<div class="clear"></div>
	</div>-->	